package springboot.test3.demo.controller;


import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springboot.test3.demo.entity.User;
import springboot.test3.demo.param.user.LoginParam;
import springboot.test3.demo.service.UserService;

import java.util.HashMap;
import java.util.List;
/**
 * @版本号 1.0
 * @开发者: dongdq
 * @创建时间: 2021/11/1 21:52
 * @Content:
 */


@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @ApiOperation("测试")
    @GetMapping("/hello")
    public Object hello() {
        System.out.println("输出");
        HashMap<String,Object> vo = new HashMap<>();
        vo.put("data","shuchu");
        return vo;
    }


    @ApiOperation("用户登陆")
    @PostMapping("/login")
    public List<User> login(@RequestBody LoginParam param){
        return userService.login(param);
    }
}
